import 'package:flutter/widgets.dart';
import 'package:netease_cloud_music_api/utils/crypto.dart';
import 'package:netease_cloud_music_api/utils/request.dart';

class PlayerRequestOptions {
  String? _cookie;
  UserAgent? _ua;
  EncryptType? _crypto;
  String? _url;
  PlayerRequestMethod? _method;
  String? _realIP;

  PlayerRequestOptions({EncryptType? crypto, String? cookie, UserAgent? ua, String? url, required PlayerRequestMethod method, String? realIP}) {
    this._cookie = cookie;
    this._crypto = crypto;
    this._ua = ua;
    this._url = url;
    this._method = method;
    this._realIP = realIP;
  }

  String? get url => this._url;

  set url(String? value) {
    _url = value;
  }

  EncryptType? get crypto => this._crypto;

  set crypto(EncryptType? value) {
    _crypto = value;
  }

  UserAgent? get ua => this._ua;

  String? get realIP => _realIP;

  set realIP(String? value) {
    _realIP = value;
  }

  set ua(UserAgent? value) {
    _ua = value;
  }

  String? get cookie => this._cookie;

  set cookie(String? value) {
    _cookie = value;
  }

  PlayerRequestMethod? get method => _method;

  set method(PlayerRequestMethod? value) {
    _method = value;
  }

  @override
  String toString() {
    return 'PlayerRequestOptions{_cookie: $_cookie, _ua: $_ua, _crypto: $_crypto, _url: $_url, _method: $_method}';
  }
}

class PlayerRequestResponse<T> {
  int? _status = 500;
  T? body;
  Map? _cookie;

  PlayerRequestResponse({int? status, this.body, Map? cookie}) {
    this._status = status;
    this._cookie = cookie;
  }

  Map? get cookie => this._cookie;

  set cookie(Map? value) {
    _cookie = value;
  }

  int? get status => this._status;

  set status(int? value) {
    _status = value;
  }
}

enum PlayerRequestMethod { post, get }